﻿using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Data;

namespace ttg_internal.Utilities.UsageVisualizer.Converter
{
    /// <summary>
    /// Converter of usage to its string representation
    /// </summary>
    internal class UsageConverter: IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            Debug.Assert(values.Length == 3 && values[0] is double && values[1] is double);
            return ((double)values[0] * (double)values[1]).ToString("F2") + values[2];
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
